//
// Created by 原帅 on 2022/10/3.
//

#include "RMemObj.h"

int RMemObj::getKey() const {
    return key;
}

int RMemObj::getShmId() const {
    return shmId;
}

void *RMemObj::getShmAddr() const {
    return shmAddr;
}

bool RMemObj::isInitialized() const {
    return initialized;
}

RMemoryInfo *RMemObj::getRMemoryInfo() const {
    return rMemoryInfo;
}

uint64_t RMemObj::nextptr() {
    return (rMemoryInfo->curnullptr<=0)?0:(rMemoryInfo->curnullptr);
}

uint64_t RMemObj::lastdataptr() {
    return (rMemoryInfo->curnullptr<=0)?0:(rMemoryInfo->curnullptr-1);
}

uint64_t RMemObj::count() {
    return this->nextptr();
}
